<?php
$this->breadcrumbs=array(
	UserModule::t('Admin')=>array('/admin/default/index'),
	UserModule::t('Transporter'),
);
$this->menu = array(
    array('label' => 'Default users', 'url' => array('/user/defaultUser/index')),
    array('label' => 'Suppliers', 'url' => array('/user/supplier/index')),
    array('label' => 'Transporters', 'url' => array('/user/transporter/index')),
    array('label' => 'Category', 'url' => array('/admin/category/index')),
    array('label' => 'Package', 'url' => array('/admin/buildTree/admin')),
    array('label' => 'Help', 'url' => array('')),
    array('label' => 'Font End', 'url' => array('')),
);
?>
<h1><?php echo UserModule::t("Manage Transporter"); echo User::lightBoxAddUser(User::S_TRANSPORTER) ; ?></h1>
<?php $this->widget('zii.widgets.grid.CGridView', array(
	'dataProvider'=>$dataProvider,
        //'filter'=>User::model(),
	'columns'=>array(
		array(
			'name' => 'id',
			'type'=>'raw',
			'value' => '$data->id',
		),
		array(
			'name' => 'username',
			'type'=>'raw',
			'value' => 'CHtml::link(CHtml::encode($data->username),"index.php?r=user/admin/view&id=".$data->id."?iframe=true",array("class"=>"view","rel"=>"prettyPhoto"))',
		),
                array(
			'name' => 'full_name',
			'type'=>'raw',
			'value' => '$data->full_name',
		),
		array(
			'name'=>'email',
			'type'=>'raw',
			'value'=>'CHtml::link(CHtml::encode($data->email), "mailto:".$data->email)',
		),
                array(
			'name'=>'status',
                        'type'=>'raw',
			'value'=>'User::itemAlias("UserStatus",$data->status)',
		),
		array(
			'name' => 'createtime',
			'value' => 'date("d.m.Y ",$data->createtime)',
		),
		array(
			'name' => 'lastvisit',
			'value' => '(($data->lastvisit)?date("d.m.Y ",$data->lastvisit):UserModule::t("Not visited"))',
		),

//		array(
//			'name'=>'superuser',
//			'value'=>'User::itemAlias("UserType",$data->superuser)',
//		),
		array(
			'class'=>'CButtonColumn',
                        'template'=>'{update}{view}',
                        'buttons'=>array(
                            'view' => array(
                                'url'=>'"index.php?r=user/admin/view&id=".$data->id."?iframe=true"',
                                    // 'click' => "function(){ $('#viewTab').load($(this).attr('href'));return false; }"
                                'options'=>array(
                                   // 'rel'=>'prettyPhoto',
                                    'title'=>'',
                                    'class'=>'view'
                                ),
                            ),
                            'update' => array(
                                'url'=>'"index.php?r=user/admin/update&id=".$data->id."?iframe=true"',
                                'options'=>array(
                                    //'rel'=>'abc',
                                    'title'=>'',
                                    'class'=>'update'
                                ),
                            )
                        ),

		),
	),
)); ?>